﻿@{
    ViewBag.Title = "Show today's orders";
}

<h2>@ViewBag.Title.</h2>
<div>
    <table>
        <tr>
            <td>Show All Orders Information:
    <table>
        @{
            foreach (var user in ViewBag.OrdersOfToday)
            {
            <tr>
                <th>User: @user.UserName
                </th>
            </tr>
            <tr>
                <th style="padding: 10px">orders</th>
                <th style="padding: 10px">cost</th>
                <th style="padding: 10px">order time</th>
            </tr>
                foreach (var order in user.UserOrderInfos)
                {
            <tr>
                <td style="padding: 10px">@order.UserOrder</td>
                <td style="padding: 10px">@order.UserCost</td>
                <td style="padding: 10px">@order.UserOrderTime</td>
            </tr>
                }
            }
        }
    </table>
            </td>

            <td>
                <div style="width: 200px">
                </div>
            </td>

            <td>
                @{
                    if (ViewBag.OrdersOfToday.Count > 0)
                    {

                        foreach (var item in ViewBag.TotalOrders)
                        {
                    <p>
                        @item<br />
                    </p> 
                        }
                    <p>总共 @ViewBag.TotalCount 份，@ViewBag.TotalCost 元.</p>
                  
                    }
                }
            </td>
        </tr>
    </table>
</div>

<aside>
    <h3>Return:</h3>
    <ul>
        <li>@Html.ActionLink("Change user balance", "ChangeUserBalance", "Home")</li>
        <li>@Html.ActionLink("Show today's orders", "ShowOrdersOfToday", "Home")</li>
        <li>@Html.ActionLink("Show all users' information", "ShowAllUser", "Home")</li>
    </ul>
</aside>


<script type="text/javascript">
    function CheckAllInfo_OnClick() {

        $.ajax({
            type: "POST",
            url: "/Home/AdminManageSearchResult",
            datatype: "json",
            data: { "str": str },
            async: false,
            success: function (result) {

            },
            error: function (error) {
            }
        });
    }

</script>
